package com.kerbores.blog.bean;

import java.util.Date;

import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Name;
import org.nutz.dao.entity.annotation.Table;
import org.nutz.lang.Lang;
import org.nutz.lang.Times;

/**
 * @author 贵源 <br>
 *         create at 2014年10月18日
 */
@Table("b_user")
public class User extends Entity {
	/**
	 * 性别枚举
	 * 
	 * @author 贵源 <br>
	 *         create at 2014年10月18日
	 */
	public static enum Sex {
		MALE, FEMALE;
		public String getMsg() {
			switch (this) {
			case MALE:
				return "男";
			default:
				return "女";
			}
		}
	}

	/**
	 * 用户级别枚举
	 * 
	 * @author 贵源 <br>
	 *         create at 2014年10月18日
	 */
	public static enum Level {
		ADMIN, VIP, EDITER, WRITER, COMMENTER, VISTER;
		public String getMsg() {
			switch (this) {
			case ADMIN:
				return "管理员";
			case VIP:
				return "VIP用户";
			case EDITER:
				return "网站编辑";
			case WRITER:
				return "网站写手";
			case COMMENTER:
				return "评论用户";
			default:
				return "访客";
			}
		}
	}

	@Column("user_name")
	@Name
	private String userName;
	@Column("password")
	private String password = Lang.md5("k-blog");
	@Column("real_name")
	private String realNanme;
	@Column("age")
	private int age;
	@Column("email")
	private String email;
	@Column("qq")
	private String qq;
	@Column("mobile")
	private String mobile;
	@Column("home_page")
	private String homePage;
	@Column("msn")
	private String msn;
	@Column("birth_day")
	private Date birthDay = Times.D(0);
	@Column("join_date")
	private Date joinDate = Times.now();
	@Column("last_login")
	private Date lastLogin = Times.now();
	@Column("last_login_ip")
	private String lastLoginIp;
	@Column("last_login_os")
	private String lastLoginOs;
	@Column("last_login_browser")
	private String lastLoginBrowser;
	@Column("level")
	private Level level = Level.VISTER;
	@Column("sex")
	private Sex sex = Sex.FEMALE;

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRealNanme() {
		return realNanme;
	}

	public void setRealNanme(String realNanme) {
		this.realNanme = realNanme;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getQq() {
		return qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getHomePage() {
		return homePage;
	}

	public void setHomePage(String homePage) {
		this.homePage = homePage;
	}

	public String getMsn() {
		return msn;
	}

	public void setMsn(String msn) {
		this.msn = msn;
	}

	public Date getBirthDay() {
		return birthDay;
	}

	public void setBirthDay(Date birthDay) {
		this.birthDay = birthDay;
	}

	public Date getJoinDate() {
		return joinDate;
	}

	public void setJoinDate(Date joinDate) {
		this.joinDate = joinDate;
	}

	public Date getLastLogin() {
		return lastLogin;
	}

	public void setLastLogin(Date lastLogin) {
		this.lastLogin = lastLogin;
	}

	public String getLastLoginIp() {
		return lastLoginIp;
	}

	public void setLastLoginIp(String lastLoginIp) {
		this.lastLoginIp = lastLoginIp;
	}

	public String getLastLoginOs() {
		return lastLoginOs;
	}

	public void setLastLoginOs(String lastLoginOs) {
		this.lastLoginOs = lastLoginOs;
	}

	public String getLastLoginBrowser() {
		return lastLoginBrowser;
	}

	public void setLastLoginBrowser(String lastLoginBrowser) {
		this.lastLoginBrowser = lastLoginBrowser;
	}

	public Level getLevel() {
		return level;
	}

	public void setLevel(Level level) {
		this.level = level;
	}

	public Sex getSex() {
		return sex;
	}

	public void setSex(Sex sex) {
		this.sex = sex;
	}

}
